#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int isPrime(int n) {
	if (n <= 1)
		return 0;
	for (int i = 2; i <= n - i; i++)
	{
		if (n % i == 0)
			return 0;
	}
	return 1;
}

int main() {
	int m, n, count;
	printf("m,n:");

	while (scanf("%d %d", &m, &n) != EOF) {
		if (m <= 0 || n <= 0)
			break;
		if (m > n) {
			int temp = m;
			m = n;
			n = temp;
		}
		count = 0;
		for (int i = m; i <= n; i++) {
			if (isPrime(i))
				count++;
		}

		printf("primer numbers=%d\n", count);
		printf("m,n:");
	}

	printf("Bye!\n");

	return 0;
}